
class P11150_39643 {
	
	static String readLn() {
		String newLine = System.getProperty("line.separator");
		StringBuilder buffer = new StringBuilder();
		int car = -1;
		try {
			car = System.in.read();
			while ((car > 0) && (car != newLine.charAt(0))) {
				buffer.append((char) car);
				car = System.in.read();
			}
			if (car == newLine.charAt(0))
				System.in.skip(newLine.length() - 1);
		} catch (java.io.IOException e) {
			return (null);
		}
		if ((car < 0) && (buffer.length() == 0))
			return (null);
		return (buffer.toString());
	}
	
	
	public static void main(String[] args) {
		int[] results = new int[201];
		results[1] = 1;
		results[2] = 3;
		results[3] = 4;
		results[4] = 6;
		results[5] = 7;
		results[6] = 9;
		results[7] = 10;
		results[8] = 12;
		results[9] = 13;
		results[10] = 15;
		results[11] = 16;
		results[12] = 18;
		results[13] = 19;
		results[14] = 21;
		results[15] = 22;
		results[16] = 24;
		results[17] = 25;
		results[18] = 27;
		results[19] = 28;
		results[20] = 30;
		results[21] = 31;
		results[22] = 33;
		results[23] = 34;
		results[24] = 36;
		results[25] = 37;
		results[26] = 39;
		results[27] = 40;
		results[28] = 42;
		results[29] = 43;
		results[30] = 45;
		results[31] = 46;
		results[32] = 48;
		results[33] = 49;
		results[34] = 51;
		results[35] = 52;
		results[36] = 54;
		results[37] = 55;
		results[38] = 57;
		results[39] = 58;
		results[40] = 60;
		results[41] = 61;
		results[42] = 63;
		results[43] = 64;
		results[44] = 66;
		results[45] = 67;
		results[46] = 69;
		results[47] = 70;
		results[48] = 72;
		results[49] = 73;
		results[50] = 75;
		results[51] = 76;
		results[52] = 78;
		results[53] = 79;
		results[54] = 81;
		results[55] = 82;
		results[56] = 84;
		results[57] = 85;
		results[58] = 87;
		results[59] = 88;
		results[60] = 90;
		results[61] = 91;
		results[62] = 93;
		results[63] = 94;
		results[64] = 96;
		results[65] = 97;
		results[66] = 99;
		results[67] = 100;
		results[68] = 102;
		results[69] = 103;
		results[70] = 105;
		results[71] = 106;
		results[72] = 108;
		results[73] = 109;
		results[74] = 111;
		results[75] = 112;
		results[76] = 114;
		results[77] = 115;
		results[78] = 117;
		results[79] = 118;
		results[80] = 120;
		results[81] = 121;
		results[82] = 123;
		results[83] = 124;
		results[84] = 126;
		results[85] = 127;
		results[86] = 129;
		results[87] = 130;
		results[88] = 132;
		results[89] = 133;
		results[90] = 135;
		results[91] = 136;
		results[92] = 138;
		results[93] = 139;
		results[94] = 141;
		results[95] = 142;
		results[96] = 144;
		results[97] = 145;
		results[98] = 147;
		results[99] = 148;
		results[100] = 150;
		results[101] = 151;
		results[102] = 153;
		results[103] = 154;
		results[104] = 156;
		results[105] = 157;
		results[106] = 159;
		results[107] = 160;
		results[108] = 162;
		results[109] = 163;
		results[110] = 165;
		results[111] = 166;
		results[112] = 168;
		results[113] = 169;
		results[114] = 171;
		results[115] = 172;
		results[116] = 174;
		results[117] = 175;
		results[118] = 177;
		results[119] = 178;
		results[120] = 180;
		results[121] = 181;
		results[122] = 183;
		results[123] = 184;
		results[124] = 186;
		results[125] = 187;
		results[126] = 189;
		results[127] = 190;
		results[128] = 192;
		results[129] = 193;
		results[130] = 195;
		results[131] = 196;
		results[132] = 198;
		results[133] = 199;
		results[134] = 201;
		results[135] = 202;
		results[136] = 204;
		results[137] = 205;
		results[138] = 207;
		results[139] = 208;
		results[140] = 210;
		results[141] = 211;
		results[142] = 213;
		results[143] = 214;
		results[144] = 216;
		results[145] = 217;
		results[146] = 219;
		results[147] = 220;
		results[148] = 222;
		results[149] = 223;
		results[150] = 225;
		results[151] = 226;
		results[152] = 228;
		results[153] = 229;
		results[154] = 231;
		results[155] = 232;
		results[156] = 234;
		results[157] = 235;
		results[158] = 237;
		results[159] = 238;
		results[160] = 240;
		results[161] = 241;
		results[162] = 243;
		results[163] = 244;
		results[164] = 246;
		results[165] = 247;
		results[166] = 249;
		results[167] = 250;
		results[168] = 252;
		results[169] = 253;
		results[170] = 255;
		results[171] = 256;
		results[172] = 258;
		results[173] = 259;
		results[174] = 261;
		results[175] = 262;
		results[176] = 264;
		results[177] = 265;
		results[178] = 267;
		results[179] = 268;
		results[180] = 270;
		results[181] = 271;
		results[182] = 273;
		results[183] = 274;
		results[184] = 276;
		results[185] = 277;
		results[186] = 279;
		results[187] = 280;
		results[188] = 282;
		results[189] = 283;
		results[190] = 285;
		results[191] = 286;
		results[192] = 288;
		results[193] = 289;
		results[194] = 291;
		results[195] = 292;
		results[196] = 294;
		results[197] = 295;
		results[198] = 297;
		results[199] = 298;
		results[200] = 300;
		
		String line = readLn();
		while (line != null) {
			System.out.println(results[Integer.parseInt(line)]);
			line = readLn();
		}
	}
}

class P11150_39643_precalc {

	static int[] multiples = new int[68];
	
	public static void main(String[] args) {
		
//		for (int k = 1; ; k++) {
//			multiples[k] = (k * 3);
//			if (k * 3 > 200) break;
//		}
//		System.out.println(Arrays.toString(multiples));
		
		for (int k = 1; k <= 200; k++) {
			process(k);
		}
		
//		process(8);
		
	}

	private static void process(int k) {
		int max = 0;
		
		for (int initialEmpty = 0; initialEmpty < 10; initialEmpty++) {
			int count = 0;
			
			int full = k;
			int empty = initialEmpty;
			
			while (full > 0) {
				count += full;
				empty += full;
				full = 0;
				full += empty / 3;
				empty = empty % 3;
			}
			
//			System.out.println("empty: " + empty);
//			
//			System.out.println("current " + count);
			if (initialEmpty <= empty) {
				if (max < count) max = count;
			}
		}
		
		System.out.println("results[" + k + "] = " + max + ";");
	}
	
}
